using System;
using System.Collections.Generic;
using System.Text;

namespace Developex.DatabaseWrapper
{
	/// <summary>
	/// 
	/// </summary>
	public interface IChildValuesField
	{
		/// <summary>
		/// Init field
		/// </summary>
		/// <param name="owner"></param>
		void Init(Row owner);

		/// <summary>
		/// Fires after object updated
		/// </summary>
		/// <param name="conn"></param>
		OperationResult OnUpdate(Connection conn);

		/// <summary>
		/// Fires after object inserted
		/// </summary>
		/// <param name="conn"></param>
		OperationResult OnInsert(Connection conn);

		/// <summary>
		/// Fires before object delete
		/// </summary>
		/// <param name="conn"></param>
		OperationResult OnBeforeDelete(Connection conn);

		/// <summary>
		/// Fires after object delete
		/// </summary>
		/// <param name="conn"></param>
		OperationResult OnDelete(Connection conn);

		/// <summary>
		/// Fires after object loaded
		/// </summary>
		/// <param name="conn"></param>
		OperationResult OnLoad(Connection conn);

		/// <summary>
		/// Is this field read-only
		/// </summary>
		bool ReadOnly { get; set; }

		/// <summary>
		/// Is child values loaded
		/// </summary>
		bool IsInitialized { get; }
	}
}
